/**
 * 
 */
package com.keggview.application.datatypes;

import org.dom4j.Element;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;

/**
 * @author Pablo
 * 
 * 
 * The subtype element specifies more detailed information about the nature of
 * the interaction or the relation. The attributes of this element are as
 * follows.
 */
public class Subtype extends Base {

	/**
	 * Interaction/relation information
	 * 
	 * The name attribute specifies the subcategory and/or the additional
	 * information in each of the three types of the generalized protein
	 * interactions. The correspondence between the type attribute of the
	 * relation element (ECrel, PPrel or GErel) and the name and value
	 * attributes of the subtype element is shown below.
	 */
	String name;
	String value;

	public final static String N_CMPND = "compound";
	public final static String N_HIDCP = "hidden compound";
	public final static String N_ACTIV = "activation";
	public final static String N_INHIB = "inhibition";
	public final static String N_EXPRS = "expression";
	public final static String N_RPRSN = "repression";
	public final static String N_INDEF = "indirect effect";
	public final static String N_STCHN = "state change";
	public final static String N_BINDG = "binding";
	public final static String N_ASSOC = "association";
	public final static String N_DISAS = "dissociation";
	public final static String N_PHOSP = "phosphorylation";
	public final static String N_DEPHO = "dephosphorylation";
	public final static String N_GLYCO = "glycosylation";
	public final static String N_UBIQI = "ubiquitination";
	public final static String N_METYL = "methylation";

	/**
	 * @param name
	 * @param value
	 */
	public Subtype(String name, String value) {
		this.name = name;
		this.value = value;
	}
	
	public Subtype(Element element) {
		this.value = element.attribute("value").getValue();
		String tempName = element.attribute("name").getValue();
		if (tempName.equals(Subtype.N_ACTIV)) {
			this.name = Subtype.N_ACTIV;
		}
		if (tempName.equals(Subtype.N_ASSOC)) {
			this.name = Subtype.N_ASSOC;
		}
		if (tempName.equals(Subtype.N_BINDG)) {
			this.name = Subtype.N_BINDG;
		}
		if (tempName.equals(Subtype.N_CMPND)) {
			this.name = Subtype.N_CMPND;
		}
		if (tempName.equals(Subtype.N_DEPHO)) {
			this.name = Subtype.N_DEPHO;
		}
		if (tempName.equals(Subtype.N_DISAS)) {
			this.name = Subtype.N_DISAS;
		}
		if (tempName.equals(Subtype.N_EXPRS)) {
			this.name = Subtype.N_EXPRS;
		}
		if (tempName.equals(Subtype.N_GLYCO)) {
			this.name = Subtype.N_GLYCO;
		}
		if (tempName.equals(Subtype.N_HIDCP)) {
			this.name = Subtype.N_HIDCP;
		}
		if (tempName.equals(Subtype.N_INDEF)) {
			this.name = Subtype.N_INDEF;
		}
		if (tempName.equals(Subtype.N_INHIB)) {
			this.name = Subtype.N_INHIB;
		}
		if (tempName.equals(Subtype.N_METYL)) {
			this.name = Subtype.N_METYL;
		}
		if (tempName.equals(Subtype.N_PHOSP)) {
			this.name = Subtype.N_PHOSP;
		}
		if (tempName.equals(Subtype.N_RPRSN)) {
			this.name = Subtype.N_RPRSN;
		}
		if (tempName.equals(Subtype.N_STCHN)) {
			this.name = Subtype.N_STCHN;
		}
		if (tempName.equals(Subtype.N_UBIQI)) {
			this.name = Subtype.N_UBIQI;
		}
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the value
	 */
	public String getValue() {
		return value;
	}

	/**
	 * @param value the value to set
	 */
	public void setValue(String value) {
		this.value = value;
	}

	@Override
	public TreeIterator<EObject> eAllContents() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public EClass eClass() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public EObject eContainer() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public EStructuralFeature eContainingFeature() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public EReference eContainmentFeature() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public EList<EObject> eContents() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public EList<EObject> eCrossReferences() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object eGet(EStructuralFeature arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object eGet(EStructuralFeature arg0, boolean arg1) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean eIsProxy() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean eIsSet(EStructuralFeature arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public Resource eResource() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void eSet(EStructuralFeature arg0, Object arg1) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void eUnset(EStructuralFeature arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public EList<Adapter> eAdapters() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean eDeliver() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void eNotify(Notification arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void eSetDeliver(boolean arg0) {
		// TODO Auto-generated method stub
		
	}
	
	

}
